{% extends 'CatalogCommonBundle:Vin:01_index.html.twig' %}
{% use 'CatalogSubaruBundle::subaru.base.html.twig' %}
{% block vinScript %}
        <script>
            $("#vin-button").on('click', function(){
                if($("#vin").val().length !== 17){
                    alert("VIN должен состоять из 17 знаков!");
                    return;
                }
                $("#vin-result").html('<img src={{ asset("bundles/catalogcommon/images/loading.gif") }} height="20px" />');
                $.ajax({
                    type:   'POST',
                    async:  false,
                    url:    "{% block vinAjaxPath %}{{ path('vin_subaru_result') }}{% endblock vinAjaxPath %}",
                    data:   { vin: $("#vin").val() },
                    success: function(data) {
                        $("#vin-result").html(data);
                    }
                });
            });
        </script>
    {% endblock vinScript %}